import static org.junit.Assert.*;

import org.junit.Test;


public class TaskOrganizerTester {

	@Test
	public void testGetTasks() {
		TaskOrganizer taskOrganizer = new TaskOrganizer();
		taskOrganizer.addNontimedTask("A", 90);
		taskOrganizer.addNontimedTask("B", 20);
		taskOrganizer.addNontimedTask("C", 82);
		taskOrganizer.addTimedTask("D", 901127, 800);
		taskOrganizer.addTimedTask("E", 880912, 1818);
		taskOrganizer.addTimedTask("F", 980828, 700);
		String[][] testNontimed = taskOrganizer.getNontimedTasks(83,3);
		String[][] testTimed = taskOrganizer.getTimedTasks(901010, 3);
		
		assertEquals(testNontimed[0][0],"1");
		assertEquals(testNontimed[0][1],"C");
		assertEquals(testNontimed[0][2],"82");
		assertEquals(testNontimed[1][0],"2");
		assertEquals(testNontimed[1][1],"B");
		assertEquals(testNontimed[1][2],"20");
		assertEquals(testNontimed[2][0],null);
		assertEquals(testNontimed[2][1],null);
		assertEquals(testNontimed[2][2],null);
		
		assertEquals(testTimed[0][0],"1");
		assertEquals(testTimed[0][1],"D");
		assertEquals(testTimed[0][2],"901127");
		assertEquals(testTimed[0][3],"0800");
		assertEquals(testTimed[1][0],"2");
		assertEquals(testTimed[1][1],"F");
		assertEquals(testTimed[1][2],"980828");
		assertEquals(testTimed[1][3],"0700");
		assertEquals(testTimed[2][0],null);
		assertEquals(testTimed[2][1],null);
		assertEquals(testTimed[2][2],null);
		assertEquals(testTimed[2][3],null);

		taskOrganizer.editNontimed(1, "C new", 84);
		taskOrganizer.editNontimed(2, "B new", 75);
		taskOrganizer.editTimed(0, "E new", 200000, 500);
		taskOrganizer.editTimed(2, "F new", 970202, 1900);		
		testNontimed = taskOrganizer.getNontimedTasks(83,3);
		testTimed = taskOrganizer.getTimedTasks(901010, 3);
		
		assertEquals(testNontimed[0][0],"2");
		assertEquals(testNontimed[0][1],"B new");
		assertEquals(testNontimed[0][2],"75");
		assertEquals(testNontimed[1][0],null);
		assertEquals(testNontimed[1][1],null);
		assertEquals(testNontimed[1][2],null);
		assertEquals(testNontimed[2][0],null);
		assertEquals(testNontimed[2][1],null);
		assertEquals(testNontimed[2][2],null);
		
		assertEquals(testTimed[0][0],"1");
		assertEquals(testTimed[0][1],"D");
		assertEquals(testTimed[0][2],"901127");
		assertEquals(testTimed[0][3],"0800");
		assertEquals(testTimed[1][0],"2");
		assertEquals(testTimed[1][1],"F new");
		assertEquals(testTimed[1][2],"970202");
		assertEquals(testTimed[1][3],"1900");
		assertEquals(testTimed[2][0],null);
		assertEquals(testTimed[2][1],null);
		assertEquals(testTimed[2][2],null);
		assertEquals(testTimed[2][3],null);

	}
	

}
